package com.example.service.impl;

import com.example.bean.User;
import com.example.mapper.UserMapper;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Renzhiping on 2018/1/17.
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;

    @Override
    public User getUserById( Long id ) {
        return userMapper.getUserById(id);
    }

    @Override
    public List<User> getUserList() {
        return userMapper.getUserList();
    }

    @Override
    public void add( User user ) {
        userMapper.add(user);
    }

    @Override
    public void update( User user ) {
        userMapper.update(user);
    }

    @Override
    public void delete( Long id ) {
        userMapper.delete(id);
    }
}
